from django.db import models

class Shop(models.Model):
    sname = models.CharField(max_length=50)
    address = models.CharField(max_length=100)
    class Meta:
        db_table = 'shop'
    def __str__(self):
        return self.sname

# Create your models here.
class Goods(models.Model):
    name = models.CharField(max_length=50)
    price = models.DecimalField(max_digits=10, decimal_places=2)
    number = models.IntegerField()
    shop = models.ForeignKey(Shop, on_delete=models.CASCADE)
    class Meta:
        db_table = 'goods'
    def __str__(self):
        return self.name





